package com.example.x3day04.ui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.x3day04.R;
import com.example.x3day04.base.BaseRlvAdapter;
import com.example.x3day04.bean.Bean;
import com.example.x3day04.bean.NaviBean;

import java.util.ArrayList;

public class RlvAdapter extends BaseRlvAdapter<Bean.ResultsBean> {

    public RlvAdapter(Context context, ArrayList<Bean.ResultsBean> list) {
        super(context, list);
    }

    @Override
    protected int getLayout() {
        return R.layout.item_rlv;
    }

    @Override
    protected void bindData(ViewHolder holder, Bean.ResultsBean resultsBean) {
        ImageView view = (ImageView) holder.findView(R.id.iv);
        Glide.with(context).load(resultsBean.getUrl()).into(view);
        holder.setText(R.id.tv,resultsBean.getType());
    }
}
